package com.auxgroup.hr.front.site.vo.person;

import com.auxgroup.hr.front.dao.domain.PsCWorkhisTbl;
import com.auxgroup.hr.front.dao.domain.PsJob;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 *
 * 工作历史记录
 * Created by nitongqian on 2019/1/19.
 */
public class JobHisVO implements Serializable, Comparable<JobHisVO> {

    private Date startDt;
    private Date endDt;
    private String cCompany;
    private String cPosition;

    private boolean inCompany;

    private static final String IN_COMPANY = "100";

    public JobHisVO(){}
    public JobHisVO(PsCWorkhisTbl psworkhis) {
        this.startDt = psworkhis.getStartDt();
        this.endDt = psworkhis.getEndDt();
        this.cCompany = psworkhis.getcCompany();
        this.cPosition = psworkhis.getcPosition();
        this.inCompany = IN_COMPANY.equals(psworkhis.getcExpWorkType());
    }
//    public JobHisVO(PsJob psJob, )

    public Date getStartDt() {
        return startDt;
    }

    public void setStartDt(Date startDt) {
        this.startDt = startDt;
    }

    public Date getEndDt() {
        return endDt;
    }

    public void setEndDt(Date endDt) {
        this.endDt = endDt;
    }

    public String getcCompany() {
        return cCompany;
    }

    public void setcCompany(String cCompany) {
        this.cCompany = cCompany;
    }

    public String getcPosition() {
        return cPosition;
    }

    public void setcPosition(String cPosition) {
        this.cPosition = cPosition;
    }

    public boolean isInCompany() {
        return inCompany;
    }

    public void setInCompany(boolean inCompany) {
        this.inCompany = inCompany;
    }

    @Override
    public int compareTo(JobHisVO o) {
        if(this.startDt == null) {
            return -1;
        } else if (o.startDt == null) {
            return 1;
        }
        return this.startDt.compareTo(o.startDt);
    }
}
